﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Operator
{
    internal class Program
    {
        static void Main(string[] args)
        {
            double a, b;
            double result;
            char ch;
            Console.WriteLine("请输入第一个数：");
            a=Double.Parse(Console.ReadLine()); 
            Console.WriteLine("请输入第二个数："); 
            b= Double.Parse(Console.ReadLine());
            Console.WriteLine("请输入运算符：");
            ch=Char.Parse(Console.ReadLine());
            
            switch(ch)
            {
                case '+':
                    result = a + b;
                    break;
                    case '-':
                    result = a - b; 
                    break ;
                    case '*':
                    result = a * b;
                    break;
                    case'/':
                    if(b!=0)
                    {
                        result = a / b;
                    }else
                    {
                        Console.WriteLine("除零错误！");
                        Console.ReadLine();
                        return;
                    }
                    break;
                    default:
                    Console.WriteLine("错误");
                    Console.ReadLine();
                    return;
                    

            }
            Console.WriteLine("结果为："+result);
            Console.ReadLine();
            return ;
        }
    }
}
